import operator
import math


class graph(object):
    def __init__(self, nodes, transitions, no_ancester=None):
        pass

    def init_rank(self):
        pass

    def tight_tree(self):
        pass

    def reachable_node(self, node):
        pass

    def init_cutvalues(self):
        pass

    def head_component(self, node, rest_edges):
        pass

    def process_ranking(self, node, level=0):
        pass

    def make_acyclic(self, parent, node, level, tree):
        pass

    def rev_edges(self, tree):
        pass

    def exchange(self, e, f):
        pass

    def enter_edge(self, edge):
        pass

    def leave_edge(self):
        pass

    def finalize_rank(self, node, level):
        pass

    def normalize(self):
        pass

    def make_chain(self):
        pass

    def init_order(self, node, level):
        pass

    def order_heuristic(self):
        pass

    def wmedian(self):
        pass

    def median_value(self, node, adj_rank):
        pass

    def adj_position(self, node, adj_rank):
        pass

    def preprocess_order(self):
        pass

    def graph_order(self):
        pass

    def tree_order(self, node, last=0):
        pass

    def process_order(self):
        pass

    def find_starts(self):
        pass

    def rank(self):
        pass

    def order_in_rank(self):
        pass

    def process(self, starting_node):
        pass

    def __str__(self):
        pass

    def scale(self, maxx, maxy, nwidth=0, nheight=0, margin=20):
        pass

    def result_get(self):
        pass


if __name__=='__main__':
    pass
